'''
工作台首页
 '''
from selenium.webdriver.common.by import By
from page.base_page import BasePage

class GongzuotaiShouye(BasePage):
    url = 'http://192.168.1.25/crm/index.php'

    # 点击添加组建
    tianjiazujian_locator = (By.ID, 'add')
    # 组件名
    zhujianming_locator = (By.ID, 'title')
    # 点击保存
    baocun_locator = (By.CSS_SELECTOR, '#dialog-message > form > div:nth-child(4) > div > input.btn.btn-primary')
    # 点击任务
    jiarenwu_locator = (By.CSS_SELECTOR, '#calendar > div.c-event-grid > div.c-task-body > div.data-head > a')
    # 点击日程
    rencheng_locator = (By.CSS_SELECTOR, '#calendar > div.c-event-grid > div.c-event-body > div.data-head > a')
    # 切换公告列表
    qiehuan_locator = (By.CSS_SELECTOR, '#widgets > div > div:nth-child(6) > div > div.dash-title > a')

    def tianjiazujian(self):
        self.driver.find_element(*self.tianjiazujian_locator).click()

    def zhujianming(self,mingcheng):
        self.driver.find_element(*self.zhujianming_locator).send_keys(mingcheng)

    def baocun(self):
        self.driver.find_element(*self.baocun_locator).click()

    def dianjirenwu(self):
        self.driver.find_element(*self.jiarenwu_locator).click()

    def dianjirecheng(self):
        self.driver.find_element(*self.rencheng_locator).click()

    def qiehuangonggao(self):
        self.driver.find_element(*self.qiehuan_locator).click()
